/*!
 * NOTICE OF LICENSE
 * 
 * @author    202 ecommerce <tech@202-ecommerce.com>
 * @author    Mondial Relay
 * @copyright Copyright (c) Mondial Relay
 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 */!function(e){var n={};function t(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(a,r,function(n){return e[n]}.bind(null,r));return a},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=13)}({0:function(e,n,t){"use strict";t.d(n,"d",(function(){return i})),t.d(n,"c",(function(){return u})),t.d(n,"b",(function(){return s})),t.d(n,"a",(function(){return _})),t.d(n,"e",(function(){return c}));var a=t(2);function r(e,n){return function(e){if(Array.isArray(e))return e}
/**
 * NOTICE OF LICENSE
 *
 * @author    202 ecommerce <tech@202-ecommerce.com>
 * @author    Mondial Relay
 * @copyright Copyright (c) Mondial Relay
 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 */(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var a,r,o,i,l=[],d=!0,c=!1;try{if(o=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;d=!1}else for(;!(d=(a=o.call(t)).done)&&(l.push(a.value),l.length!==n);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw r}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return o(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=Array(n);t<n;t++)a[t]=e[t];return a}var i=function(){for(var e=0,n=Object.entries(MONDIALRELAY_CARRIER_METHODS);e<n.length;e++){var t=r(n[e],2),a=t[0],o=t[1];(["ES","IT","PT"].includes(MONDIALRELAY_COUNTRY_ISO)&&"IP"!==o.delivery_type||!["ES","IT","PT"].includes(MONDIALRELAY_COUNTRY_ISO)&&"MR"!==o.delivery_type||!MONDIALRELAY_ADDRESS_OPC)&&(o=$('[name^="delivery_option"][value="'+a+',"]')[0])&&l(o,d)}},l=function(e,n){var t;(t=e.closest(".delivery-option")||e.closest(".delivery_option"))&&n(t)},d=function(e){e.remove()},c=a.a,u=function(){return MONDIALRELAY_NATIVE_RELAY_CARRIERS_IDS.includes(s())},s=function(){var e=$('[name^="delivery_option"]:checked').val();if(void 0!==e){var n=e.split(",");e=n[0]}return e||!1},_=function(e){return MONDIALRELAY_CARRIER_METHODS[e]?MONDIALRELAY_CARRIER_METHODS[e].delivery_mode:null};$(document).ready((function(){i()})),$(document).on("click",c.save_button,(function(e){e.preventDefault(),e.stopPropagation(),c.displayErrors(null),$(c.summary_container).empty().show(),c.addLoader(c.summary_container),$(c).trigger("mondialrelay.saveSelectedRelay.before");var n={ajax:!0,action:"saveSelectedRelay",mondialrelay_selectedRelay:MONDIALRELAY_SELECTED_RELAY_IDENTIFIER||0,mondialrelay_selectedRelay_infos:MONDIALRELAY_SELECTED_RELAY_INFOS||[],id_carrier:s()};return $.ajax({type:"POST",url:MONDIALRELAY_AJAX_CHECKOUT_URL,data:n,dataType:"json",success:function(e){if(e){if("ok"!=e.status)return c.savedRelay=null,e.error.length&&c.displayErrors(e.error),c.removeLoader($(c.summary_container)),void $(c).trigger("mondialrelay.saveSelectedRelay.error");c.savedRelay=MONDIALRELAY_SELECTED_RELAY_IDENTIFIER,$(c.summary_container).html(e.content.relaySummary),c.hide(),$(c.save_container).hide(),$(c.widget_container).slideUp(),$(c.save_container).slideUp(),$(c).trigger("mondialrelay.saveSelectedRelay.success")}else this.error(e)},error:function(e){c.savedRelay=null,alert(MONDIALRELAY_SAVE_RELAY_ERROR),$(c).trigger("mondialrelay.saveSelectedRelay.error"),c.removeLoader($(c.summary_container))}}),!1}));var y=function(){var e=s();if(e){var n=_(e);if(n)$("#mondialrelay_save-container").show(),$(".mondialrelay_save-relay").hide().removeAttr("id"),$('.mondialrelay_save-relay[data-mr-mode="'.concat(n,'"]')).attr("id","mondialrelay_save-relay").show();else $("#mondialrelay_save-container").hide()}};$(document).ready((function(){y(),prestashop.on("updatedDeliveryForm",(function(){y()}))}))},13:function(e,n,t){"use strict";t.r(n);var a=t(0),r=null,o=null,i=null,l=function(){return r=$('[name^="delivery_option"]:checked').closest(".delivery-option").next(".carrier-extra-content")};
/**
 * NOTICE OF LICENSE
 *
 * @author    202 ecommerce <tech@202-ecommerce.com>
 * @author    Mondial Relay
 * @copyright Copyright (c) Mondial Relay
 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 */$("#mondialrelay_save-relay").on("click",(function(){$('button.continue[name="confirmDeliveryOption"]').removeAttr("disabled")}));var d=function(e){e?($("#checkout-delivery-step").removeClass("-complete"),$("button[name='confirmDeliveryOption']").attr("disabled",!0)):($("#checkout-delivery-step").addClass("-complete"),$("button[name='confirmDeliveryOption']").attr("disabled",!1))};$(document).ready((function(){var e;MONDIALRELAY_CARRIER_METHODS.length>0&&(e=MONDIALRELAY_CARRIER_METHODS[Object.keys(MONDIALRELAY_CARRIER_METHODS)[0]].id_carrier,r=$("#delivery_option_"+e).closest(".delivery-option").next(".carrier-extra-content"),$("#mondialrelay_content").appendTo(r),a.e.init({ColLivMod:a.a(MONDIALRELAY_CARRIER_METHODS[Object.keys(MONDIALRELAY_CARRIER_METHODS)[0]].id_carrier)}))})),$(a.e).on("mondialrelay.ready",(function(){a.c()&&(l(),null===i&&(i=$("#checkout-payment-step").hasClass("-reachable")),$("#checkout-payment-step").removeClass("-reachable").addClass("-unreachable"),$("#mondialrelay_content").appendTo(r),a.e.savedRelay?($(a.e.summary_container).show(),a.e.hide(),$("#checkout-payment-step").hasClass("-unreachable")&&$("#checkout-payment-step").removeClass("-unreachable").addClass("-reachable")):(d(!0),a.e.show()),a.e.init({ColLivMod:a.a(a.b())})),$(a.e.widget_container).on("click",(function(e){e.preventDefault(),e.stopPropagation()}))})),$(document).on("submit","#js-delivery",(function(e){return!(a.c()&&!a.e.savedRelay)||(e.preventDefault(),e.stopPropagation(),l(),$("#mondialrelay_content").appendTo(r),a.e.initOrUpdate({ColLivMod:a.a(a.b())}),alert(MONDIALRELAY_NO_SELECTION_ERROR),!1)})),prestashop.on("updatedDeliveryForm",(function(){a.e.savedRelay=MONDIALRELAY_SELECTED_RELAY_IDENTIFIER})),$(document).on("change",'#js-delivery [name^="delivery_option"]',(function(e){if(!a.c())return r&&(r.hide(),r=null),d(!1),a.e.resetSelectedRelay(),a.e.resetSavedRelay(!0),o&&($("#checkout-payment-step .content").append(o),o=null),void(null!==i&&i&&$("#checkout-payment-step").addClass("-reachable").removeClass("-unreachable"));(o=$(".js-cart-payment-step-refresh").clone(),$(".js-cart-payment-step-refresh").remove(),null===i&&(i=$("#checkout-payment-step").hasClass("-reachable")),$("#checkout-payment-step").removeClass("-reachable").addClass("-unreachable"),a.e.savedRelay?$(e.target).is(a.e.selected_relay_input)||a.e.hide():(d(!0),a.e.show()),r&&r.hide(),null!=a.e.widget_current_params)&&(a.e.widget_current_params.ColLivMod!=a.a(a.b())&&(a.e.resetSelectedRelay(),a.e.resetSavedRelay()));l(),$("#mondialrelay_content").appendTo(r),a.e.initOrUpdate({ColLivMod:a.a(a.b())})})),$("#js-delivery").on("change","#mondialrelay_content *",(function(e){e.preventDefault(),e.stopPropagation()})),$(a.e).on("mondialrelay.saveSelectedRelay.before",(function(){d(!0),$("[name^='delivery_option']").attr("readonly",!0).on("click.mondialrelay.lock",(function(e){e.preventDefault(),e.stopPropagation()}))})),$(a.e).on("mondialrelay.saveSelectedRelay.success",(function(){d(!1),$("[name^='delivery_option']").attr("readonly",!1).off("click.mondialrelay.lock")})),$(a.e).on("mondialrelay.saveSelectedRelay.error",(function(){d(!0),$("[name^='delivery_option']").attr("readonly",!1).off("click.mondialrelay.lock")})),window.mondialrelayWidget=a.e},2:function(e,n,t){"use strict";t.d(n,"a",(function(){return a}));
/**
 * NOTICE OF LICENSE
 *
 * @author    202 ecommerce <tech@202-ecommerce.com>
 * @author    Mondial Relay
 * @copyright Copyright (c) Mondial Relay
 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 */
var a={url:"//widget.mondialrelay.com/parcelshop-picker/jquery.plugin.mondialrelay.parcelshoppicker.min.js",loaded:!1,initialized:!1,widget_container:"#mondialrelay_widget",save_container:"#mondialrelay_save-container",error_container:"#mondialrelay_errors",summary_container:"#mondialrelay_summary",save_button:".mondialrelay_save-relay",change_button:"#mondialrelay_change-relay",selected_relay_input:"#mondialrelay_selected-relay",widget_search_zipcode_input:"#mondialrelay_widget .MRW-Search .Arg2",widget_search_country_input:"#mondialrelay_widget .MRW-Search .Arg1",savedRelay:null,widget_current_params:null};a.load=function(e){!function(e,n){var t=document.createElement("script");t.onload=n,t.src=e,document.head.appendChild(t)}(a.url,(function(){a.loaded=!0,e()}))},a.init=function(e){if("undefined"==typeof MONDIALRELAY_BAD_CONFIGURATION||!MONDIALRELAY_BAD_CONFIGURATION){if(a.savedRelay&&$(a.summary_container).slideDown(),!a.loaded)return a.addLoader(a.widget_container),void a.load((function(){a.init(e)}));var n={Target:a.selected_relay_input,Brand:MONDIALRELAY_ENSEIGNE,Country:MONDIALRELAY_COUNTRY_ISO,PostCode:MONDIALRELAY_POSTCODE,ShowResultsOnMap:1==MONDIALRELAY_DISPLAY_MAP,NbResults:"7",Responsive:!0,WidgetLanguage:MONDIALRELAY_LANG_ISO,OnParcelShopSelected:function(e){$(a.save_container).show(),a.setSelectedRelay(null,e)}};n.Theme=["ES","IT","PT"].includes(MONDIALRELAY_COUNTRY_ISO)?"inpost":"mondialrelay",e&&$.extend(n,e),a.widget_current_params=n,$(a.widget_container).MR_ParcelShopPicker(n),a.initialized=!0}},a.show=function(){$(a.widget_container).show()},a.hide=function(){$(a.widget_container).hide()},a.update=function(e){$(a.widget_container).trigger("MR_SetParams",e),a.widget_current_params=$.extend(a.widget_current_params,e),a.doSearch()},a.initOrUpdate=function(e){a.initialized?a.update(e):a.init(e)},a.setSelectedRelay=function(e,n){if(window.MONDIALRELAY_SELECTED_RELAY_INFOS=n,void 0!==e&&e||(e=$(a.selected_relay_input).val()),e==$(a.selected_relay_input).val()&&MONDIALRELAY_SELECTED_RELAY_IDENTIFIER!=e){var t=MONDIALRELAY_SELECTED_RELAY_IDENTIFIER;MONDIALRELAY_SELECTED_RELAY_IDENTIFIER=e,$(a).trigger("mondialrelay.selectedRelay",{oldRelay:t,relayData:n})}},a.resetSelectedRelay=function(){var e=MONDIALRELAY_SELECTED_RELAY_IDENTIFIER;MONDIALRELAY_SELECTED_RELAY_IDENTIFIER=null,window.MONDIALRELAY_SELECTED_RELAY_INFOS=[],$(a).trigger("mondialrelay.selectedRelay",{oldRelay:e,relayData:null})},a.resetSavedRelay=function(e){a.savedRelay=null,void 0!==e&&e||($(a.summary_container).slideUp(),$(a.widget_container).slideDown(),$(a.save_container).slideDown())},a.doSearch=function(e,n){var t=[void 0!==e&&e?e:$(a.widget_search_zipcode_input).val(),void 0!==n&&n?n:$(a.widget_search_country_input).val()];$(a.widget_container).trigger("MR_DoSearch",t)},a.displayErrors=function(e){var n=$(a.error_container);0!=n.length&&(n.stop(!0),n.children().length&&n.fadeOut((function(){$(this).empty()})),void 0!==e&&e&&(n.queue((function(){var n=[];$.each(e,(function(e,t){n.push($("<div/>").addClass("alert alert-danger").text(t))})),$(this).append(n),$(this).dequeue()})),n.fadeIn()))},a.addLoader=function(e){0!=$(e).length&&($(e).children(".mondialrelay_loader").length>0||$("#mondialrelay_loader-template").clone().attr("id",null).show().appendTo(e))},a.removeLoader=function(e){$(e).children(".mondialrelay_loader").remove()},$(document).ready((function(){a.savedRelay=MONDIALRELAY_SELECTED_RELAY_IDENTIFIER,$(a).trigger("mondialrelay.ready")})),$(document).on("click",a.change_button,(function(e){a.show()})),$(document).on("click",".MRW-ShowList",(function(e){e.preventDefault(),e.stopPropagation()})),$(document).on("click",".PR-City",(function(e){e.preventDefault(),e.stopPropagation()}))}});